package com.xinqi.modules.exam.paper.enums;

import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonValue;
import com.xinqi.common.base.enums.BaseEnum;
import lombok.Getter;

/**
 * 测评多选得分, 1:少选时，得一半分数 2:多选、少选、选错不得分
 *
 * @author linkai
 * @date 2023/7/2
 */
public enum MultipleOptionScoreEnum implements BaseEnum {
    少选时_得一半分数("1", "少选时，得一半分数"),
    多选_少选_选错不得分("2", "多选、少选、选错不得分"),
    ;

    @Getter(onMethod_ = {@JsonValue})
    private final String code;

    @Getter
    private final String describe;

    MultipleOptionScoreEnum(String code, String describe) {
        this.code = code;
        this.describe = describe;
    }

    @JsonCreator
    public static MultipleOptionScoreEnum of(String code) {
        return BaseEnum.of(MultipleOptionScoreEnum.class, code);
    }
}
